// 组织的接口
import request from '@/utils/request'
// 获取部门列表
export const reqGetDepts = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 * **/
export const reqDelDepartments = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 新增部门
export const reqAddDept = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 根据id查询部门信息
export const reqGetDeptInfo = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
// 编辑部门提交
export const reqUpdateDept = (data) => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
